/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PageDialogPane.java
 *
 * Created on 23-mar-2010, 12:53:03
 */

package geobloc.desktop.dialogs;

import java.util.Vector;

/**
 *
 * @author Usuario
 */
public class PageDialogPane extends javax.swing.JPanel {

    /** Creates new form PageDialogPane */
    public PageDialogPane() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        actionButtonGroup = new javax.swing.ButtonGroup();
        nameLabel = new javax.swing.JLabel();
        nameTextField = new javax.swing.JTextField();
        actionLabel = new javax.swing.JLabel();
        dataButton = new javax.swing.JRadioButton();
        photoButton = new javax.swing.JRadioButton();
        audioButton = new javax.swing.JRadioButton();
        mapButton = new javax.swing.JRadioButton();
        videoButton = new javax.swing.JRadioButton();
        idLabel = new javax.swing.JLabel();
        idTextField = new javax.swing.JTextField();
        requiredCheckBox = new javax.swing.JCheckBox();

        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(geobloc.desktop.FormDesignerApp.class).getContext().getResourceMap(PageDialogPane.class);
        nameLabel.setText(resourceMap.getString("nameLabel.text")); // NOI18N
        nameLabel.setName("nameLabel"); // NOI18N

        nameTextField.setText(resourceMap.getString("nameTextField.text")); // NOI18N
        nameTextField.setName("nameTextField"); // NOI18N

        actionLabel.setText(resourceMap.getString("actionLabel.text")); // NOI18N
        actionLabel.setName("actionLabel"); // NOI18N

        actionButtonGroup.add(dataButton);
        dataButton.setSelected(true);
        dataButton.setText(resourceMap.getString("dataButton.text")); // NOI18N
        dataButton.setActionCommand(resourceMap.getString("dataButton.actionCommand")); // NOI18N
        dataButton.setName("dataButton"); // NOI18N

        actionButtonGroup.add(photoButton);
        photoButton.setText(resourceMap.getString("photoButton.text")); // NOI18N
        photoButton.setActionCommand(resourceMap.getString("photoButton.actionCommand")); // NOI18N
        photoButton.setName("photoButton"); // NOI18N

        actionButtonGroup.add(audioButton);
        audioButton.setText(resourceMap.getString("audioButton.text")); // NOI18N
        audioButton.setActionCommand(resourceMap.getString("audioButton.actionCommand")); // NOI18N
        audioButton.setName("audioButton"); // NOI18N

        actionButtonGroup.add(mapButton);
        mapButton.setText(resourceMap.getString("mapButton.text")); // NOI18N
        mapButton.setActionCommand(resourceMap.getString("mapButton.actionCommand")); // NOI18N
        mapButton.setName("mapButton"); // NOI18N

        actionButtonGroup.add(videoButton);
        videoButton.setText(resourceMap.getString("videoButton.text")); // NOI18N
        videoButton.setActionCommand(resourceMap.getString("videoButton.actionCommand")); // NOI18N
        videoButton.setName("videoButton"); // NOI18N

        idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
        idLabel.setName("idLabel"); // NOI18N

        idTextField.setText(resourceMap.getString("idTextField.text")); // NOI18N
        idTextField.setName("idTextField"); // NOI18N

        requiredCheckBox.setText(resourceMap.getString("requiredCheckBox.text")); // NOI18N
        requiredCheckBox.setName("requiredCheckBox"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(dataButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(photoButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(videoButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(audioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(mapButton))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(actionLabel, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(nameLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(idLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(requiredCheckBox)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nameLabel)
                    .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(idLabel))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(actionLabel)
                    .addComponent(requiredCheckBox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(dataButton)
                    .addComponent(photoButton)
                    .addComponent(videoButton)
                    .addComponent(audioButton)
                    .addComponent(mapButton)))
        );
    }// </editor-fold>//GEN-END:initComponents


    /*  Parameters struct
     *  parameters[0] - id
     *  parameters[1] - page name
     *  parameters[2] - page action
     *  parameters[3] - is Required
     * 
     */
    public Vector<String> getResults() {
        Vector<String> parameters = new Vector<String>();
        parameters.add(idTextField.getText());
        parameters.add(nameTextField.getText());
        parameters.add(actionButtonGroup.getSelection().getActionCommand());
        if (requiredCheckBox.isSelected())
            parameters.add("true");
        else
            parameters.add("false");
        return parameters;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup actionButtonGroup;
    private javax.swing.JLabel actionLabel;
    private javax.swing.JRadioButton audioButton;
    private javax.swing.JRadioButton dataButton;
    private javax.swing.JLabel idLabel;
    private javax.swing.JTextField idTextField;
    private javax.swing.JRadioButton mapButton;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JTextField nameTextField;
    private javax.swing.JRadioButton photoButton;
    private javax.swing.JCheckBox requiredCheckBox;
    private javax.swing.JRadioButton videoButton;
    // End of variables declaration//GEN-END:variables

}
